home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / 3dtabs / dialog.frm (.txt) next >
Encoding:
Visual Basic Form  |  1995-05-08  |  32.9 KB  |  886 lines

  1. VERSION 2.00
  2. Begin Form dlg 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   3  'Fixed Double
  5.    Caption         =   "DialogBox"
  6.    ClientHeight    =   5445
  7.    ClientLeft      =   1890
  8.    ClientTop       =   1095
  9.    ClientWidth     =   6255
  10.    ForeColor       =   &H00000000&
  11.    Height          =   5850
  12.    Left            =   1830
  13.    LinkTopic       =   "Form1"
  14.    ScaleHeight     =   5445
  15.    ScaleWidth      =   6255
  16.    Top             =   750
  17.    Width           =   6375
  18.    Begin PictureBox tabbox 
  19.       BackColor       =   &H00C0C0C0&
  20.       BorderStyle     =   0  'None
  21.       ForeColor       =   &H00000000&
  22.       Height          =   495
  23.       Left            =   360
  24.       ScaleHeight     =   33
  25.       ScaleMode       =   3  'Pixel
  26.       ScaleWidth      =   345
  27.       TabIndex        =   0
  28.       Top             =   120
  29.       Width           =   5175
  30.       Begin PictureBox invbox 
  31.          AutoRedraw      =   -1  'True
  32.          BackColor       =   &H00C0C0C0&
  33.          BorderStyle     =   0  'None
  34.          Height          =   255
  35.          Left            =   1440
  36.          ScaleHeight     =   17
  37.          ScaleMode       =   3  'Pixel
  38.          ScaleWidth      =   81
  39.          TabIndex        =   1
  40.          Top             =   240
  41.          Visible         =   0   'False
  42.          Width           =   1215
  43.       End
  44.    End
  45.    Begin PictureBox PicBox 
  46.       BackColor       =   &H00C0C0C0&
  47.       Height          =   4215
  48.       Index           =   5
  49.       Left            =   960
  50.       ScaleHeight     =   4185
  51.       ScaleWidth      =   5625
  52.       TabIndex        =   7
  53.       Tag             =   "About this control"
  54.       Top             =   600
  55.       Width           =   5655
  56.       Begin Label l 
  57.          BackStyle       =   0  'Transparent
  58.          Caption         =   "Please feel free to modify this code in any way you please. If you make any signifigant improvements, upload the files. Suggestions: 3D effects for the Form, more tab styles, multiple focus (one for each row),"
  59.          FontBold        =   0   'False
  60.          FontItalic      =   0   'False
  61.          FontName        =   "MS Sans Serif"
  62.          FontSize        =   8.25
  63.          FontStrikethru  =   0   'False
  64.          FontUnderline   =   0   'False
  65.          Height          =   855
  66.          Index           =   38
  67.          Left            =   480
  68.          TabIndex        =   46
  69.          Top             =   3120
  70.          Width           =   4815
  71.       End
  72.       Begin Label l 
  73.          BackStyle       =   0  'Transparent
  74.          Caption         =   "Since this control is VB source code and freely modifiable by the user, I didn't feel it was necessary to anticipate every possible usage. Most of this kind of code would need to be removed each time it was used.. For example, the Resize code can be removed if your forms are not sizable."
  75.          FontBold        =   0   'False
  76.          FontItalic      =   0   'False
  77.          FontName        =   "MS Sans Serif"
  78.          FontSize        =   8.25
  79.          FontStrikethru  =   0   'False
  80.          FontUnderline   =   0   'False
  81.          Height          =   1095
  82.          Index           =   37
  83.          Left            =   480
  84.          TabIndex        =   45
  85.          Top             =   1920
  86.          Width           =   4815
  87.       End
  88.       Begin Label l 
  89.          BackStyle       =   0  'Transparent
  90.          Caption         =   "This control is Freeware. It is based on a similar control written by James Parr and uploaded to compuserve. It is 100% VB code, no DLL's, no VBX's, yet it should perform about as well. This control adds 3D effects, multiple instances, and mixed control types for pages."
  91.          FontBold        =   0   'False
  92.          FontItalic      =   0   'False
  93.          FontName        =   "MS Sans Serif"
  94.          FontSize        =   8.25
  95.          FontStrikethru  =   0   'False
  96.          FontUnderline   =   0   'False
  97.          Height          =   1095
  98.          Index           =   36
  99.          Left            =   480
  100.          TabIndex        =   44
  101.          Top             =   720
  102.          Width           =   4815
  103.       End
  104.       Begin Label l 
  105.          BackStyle       =   0  'Transparent
  106.          Caption         =   "V. About this control."
  107.          FontBold        =   -1  'True
  108.          FontItalic      =   0   'False
  109.          FontName        =   "MS Sans Serif"
  110.          FontSize        =   12
  111.          FontStrikethru  =   0   'False
  112.          FontUnderline   =   0   'False
  113.          Height          =   375
  114.          Index           =   35
  115.          Left            =   120
  116.          TabIndex        =   43
  117.          Top             =   120
  118.          Width           =   5295
  119.       End
  120.    End
  121.    Begin PictureBox PicBox 
  122.       BackColor       =   &H00C0C0C0&
  123.       Height          =   4215
  124.       Index           =   4
  125.       Left            =   1200
  126.       ScaleHeight     =   4185
  127.       ScaleWidth      =   5625
  128.       TabIndex        =   6
  129.       Tag             =   "Step 4"
  130.       Top             =   600
  131.       Width           =   5655
  132.       Begin Label l 
  133.          BackStyle       =   0  'Transparent
  134.          Caption         =   "The tab control is generated by first drawing one tab in the proper size and orientation (invbox) and then blitting this picture to the visible picturebox (tabbox). Rescaling and StretchBlting seemed even more cumbersome than the method used. When a tab is clicked, only the tab captions  and the focus line are redrawn. While the speed could be improved a little, the response of the control seems to depend more on the pages and their contents at this point than on the tab element."
  135.          FontBold        =   0   'False
  136.          FontItalic      =   0   'False
  137.          FontName        =   "MS Sans Serif"
  138.          FontSize        =   8.25
  139.          FontStrikethru  =   0   'False
  140.          FontUnderline   =   0   'False
  141.          Height          =   1695
  142.          Index           =   34
  143.          Left            =   480
  144.          TabIndex        =   42
  145.          Top             =   2280
  146.          Width           =   4815
  147.       End
  148.       Begin Label l 
  149.          BackStyle       =   0  'Transparent
  150.          Caption         =   "Run the project and examine the control. The code controlling the graphic appearance is in DrawTabs(). TabClick() controls the behavior of the tabs when clicked. Try resetting the tb.num and tb.cols values. Note that unused spaces are filled with unlabeled tabs; this was done because of the awkward effect produced when a partial row was moved beneath a full row, so be prepared to tackle this problem if you wish to eliminate unused tabs."
  151.          FontBold        =   0   'False
  152.          FontItalic      =   0   'False
  153.          FontName        =   "MS Sans Serif"
  154.          FontSize        =   8.25
  155.          FontStrikethru  =   0   'False
  156.          FontUnderline   =   0   'False
  157.          Height          =   1455
  158.          Index           =   33
  159.          Left            =   480
  160.          TabIndex        =   41
  161.          Top             =   720
  162.          Width           =   4815
  163.       End
  164.       Begin Label l 
  165.          BackStyle       =   0  'Transparent
  166.          Caption         =   "IV. That's it!"
  167.          FontBold        =   -1  'True
  168.          FontItalic      =   0   'False
  169.          FontName        =   "MS Sans Serif"
  170.          FontSize        =   12
  171.          FontStrikethru  =   0   'False
  172.          FontUnderline   =   0   'False
  173.          Height          =   375
  174.          Index           =   32
  175.          Left            =   120
  176.          TabIndex        =   40
  177.          Top             =   120
  178.          Width           =   5295
  179.       End
  180.    End
  181.    Begin PictureBox PicBox 
  182.       BackColor       =   &H00C0C0C0&
  183.       Height          =   4215
  184.       Index           =   3
  185.       Left            =   1080
  186.       ScaleHeight     =   4185
  187.       ScaleWidth      =   5625
  188.       TabIndex        =   5
  189.       Tag             =   "Step 3"
  190.       Top             =   600
  191.       Width           =   5655
  192.       Begin Label l 
  193.          BackStyle       =   0  'Transparent
  194.          Caption         =   "Size the first member of the page() array to the proper size. All the pages will be resized automatically to match it, and the tabbox and Form will be resized to fit it. See the other samples for examples of how to position the tabs on other types of Forms."
  195.          FontBold        =   0   'False
  196.          FontItalic      =   0   'False
  197.          FontName        =   "MS Sans Serif"
  198.          FontSize        =   8.25
  199.          FontStrikethru  =   0   'False
  200.          FontUnderline   =   0   'False
  201.          Height          =   975
  202.          Index           =   31
  203.          Left            =   480
  204.          TabIndex        =   39
  205.          Top             =   720
  206.          Width           =   4815
  207.       End
  208.       Begin Label l 
  209.          BackStyle       =   0  'Transparent
  210.          Caption         =   "If Keycode = H22 then NextPage"
  211.          FontBold        =   0   'False
  212.          FontItalic      =   0   'False
  213.          FontName        =   "MS Sans Serif"
  214.          FontSize        =   8.25
  215.          FontStrikethru  =   0   'False
  216.          FontUnderline   =   0   'False
  217.          Height          =   255
  218.          Index           =   30
  219.          Left            =   480
  220.          TabIndex        =   38
  221.          Top             =   3840
  222.          Width           =   3855
  223.       End
  224.       Begin Label l 
  225.          BackStyle       =   0  'Transparent
  226.          Caption         =   "If Keycode = H21 then PrevPage"
  227.          FontBold        =   0   'False
  228.          FontItalic      =   0   'False
  229.          FontName        =   "MS Sans Serif"
  230.          FontSize        =   8.25
  231.          FontStrikethru  =   0   'False
  232.          FontUnderline   =   0   'False
  233.          Height          =   255
  234.          Index           =   29
  235.          Left            =   480
  236.          TabIndex        =   37
  237.          Top             =   3600
  238.          Width           =   3855
  239.       End
  240.       Begin Label l 
  241.          BackStyle       =   0  'Transparent
  242.          Caption         =   "tb.orient = 1   ' 0 = up, 1 = down"
  243.          FontBold        =   0   'False
  244.          FontItalic      =   0   'False
  245.          FontName        =   "MS Sans Serif"
  246.          FontSize        =   8.25
  247.          FontStrikethru  =   0   'False
  248.          FontUnderline   =   0   'False
  249.          Height          =   255
  250.          Index           =   28
  251.          Left            =   480
  252.          TabIndex        =   36
  253.          Top             =   2760
  254.          Width           =   3855
  255.       End
  256.       Begin Label l 
  257.          BackStyle       =   0  'Transparent
  258.          Caption         =   "III. Set additional properties."
  259.          FontBold        =   -1  'True
  260.          FontItalic      =   0   'False
  261.          FontName        =   "MS Sans Serif"
  262.          FontSize        =   12
  263.          FontStrikethru  =   0   'False
  264.          FontUnderline   =   0   'False
  265.          Height          =   375
  266.          Index           =   27
  267.          Left            =   120
  268.          TabIndex        =   35
  269.          Top             =   120
  270.          Width           =   5295
  271.       End
  272.       Begin Label l 
  273.          BackStyle       =   0  'Transparent
  274.          Caption         =   "If you wish to handle keyboard events, add code such as the following to the Form's KeyDown event."
  275.          FontBold        =   0   'False
  276.          FontItalic      =   0   'False
  277.          FontName        =   "MS Sans Serif"
  278.          FontSize        =   8.25
  279.          FontStrikethru  =   0   'False
  280.          FontUnderline   =   0   'False
  281.          Height          =   495
  282.          Index           =   22
  283.          Left            =   480
  284.          TabIndex        =   8
  285.          Top             =   3120
  286.          Width           =   4935
  287.       End
  288.       Begin Label l 
  289.          BackStyle       =   0  'Transparent
  290.          Caption         =   "If you want the tabs to appear below the pages, add the following line to Form_Load before calling DefineControl():"
  291.          FontBold        =   0   'False
  292.          FontItalic      =   0   'False
  293.          FontName        =   "MS Sans Serif"
  294.          FontSize        =   8.25
  295.          FontStrikethru  =   0   'False
  296.          FontUnderline   =   0   'False
  297.          Height          =   495
  298.          Index           =   21
  299.          Left            =   480
  300.          TabIndex        =   9
  301.          Top             =   2280
  302.          Width           =   4935
  303.       End
  304.       Begin Label l 
  305.          BackStyle       =   0  'Transparent
  306.          Caption         =   "If you wish to set the Font properties of the tab captions, set the properties of the tabbox picturebox to the desired settings."
  307.          FontBold        =   0   'False
  308.          FontItalic      =   0   'False
  309.          FontName        =   "MS Sans Serif"
  310.          FontSize        =   8.25
  311.          FontStrikethru  =   0   'False
  312.          FontUnderline   =   0   'False
  313.          Height          =   495
  314.          Index           =   20
  315.          Left            =   480
  316.          TabIndex        =   10
  317.          Top             =   1680
  318.          Width           =   4935
  319.       End
  320.    End
  321.    Begin PictureBox PicBox 
  322.       BackColor       =   &H00C0C0C0&
  323.       Height          =   4215
  324.       Index           =   1
  325.       Left            =   120
  326.       ScaleHeight     =   4185
  327.       ScaleWidth      =   5625
  328.       TabIndex        =   3
  329.       Tag             =   "Step 1"
  330.       Top             =   600
  331.       Width           =   5655
  332.       Begin Label l 
  333.          BackStyle       =   0  'Transparent
  334.          Caption         =   "I. Creating the controls."
  335.          FontBold        =   -1  'True
  336.          FontItalic      =   0   'False
  337.          FontName        =   "MS Sans Serif"
  338.          FontSize        =   12
  339.          FontStrikethru  =   0   'False
  340.          FontUnderline   =   0   'False
  341.          Height          =   375
  342.          Index           =   25
  343.          Left            =   120
  344.          TabIndex        =   33
  345.          Top             =   120
  346.          Width           =   5295
  347.       End
  348.       Begin Label l 
  349.          BackStyle       =   0  'Transparent
  350.          Caption         =   "4. Set the tag property of each pictuebox to the text you want to appear on the tab for this page. Add whatever controls you want on each page to the appropriate PicBox().."
  351.          FontBold        =   0   'False
  352.          FontItalic      =   0   'False
  353.          FontName        =   "MS Sans Serif"
  354.          FontSize        =   8.25
  355.          FontStrikethru  =   0   'False
  356.          FontUnderline   =   0   'False
  357.          Height          =   735
  358.          Index           =   7
  359.          Left            =   480
  360.          TabIndex        =   22
  361.          Top             =   3240
  362.          Width           =   4695
  363.       End
  364.       Begin Label l 
  365.          BackStyle       =   0  'Transparent
  366.          Caption         =   "3. Create a control array of 6 pictureboxes. (Any control which can act as container can be used instead of pictureboxes.) These are the 'pages'. On this Form, they are PicBox(0) - PicBox(5)."
  367.          FontBold        =   0   'False
  368.          FontItalic      =   0   'False
  369.          FontName        =   "MS Sans Serif"
  370.          FontSize        =   8.25
  371.          FontStrikethru  =   0   'False
  372.          FontUnderline   =   0   'False
  373.          Height          =   855
  374.          Index           =   6
  375.          Left            =   480
  376.          TabIndex        =   21
  377.          Top             =   2280
  378.          Width           =   4695
  379.       End
  380.       Begin Label l 
  381.          BackStyle       =   0  'Transparent
  382.          Caption         =   "2. Set borderstyle=0 and scalemode=3 on both pictureboxes. Set visible=False on the child picturebox (invbox). Set the backcolor of both boxes and the Form to light grey"
  383.          FontBold        =   0   'False
  384.          FontItalic      =   0   'False
  385.          FontName        =   "MS Sans Serif"
  386.          FontSize        =   8.25
  387.          FontStrikethru  =   0   'False
  388.          FontUnderline   =   0   'False
  389.          Height          =   615
  390.          Index           =   5
  391.          Left            =   480
  392.          TabIndex        =   20
  393.          Top             =   1440
  394.          Width           =   4695
  395.       End
  396.       Begin Label l 
  397.          BackStyle       =   0  'Transparent
  398.          Caption         =   "1. Create a picturebox. Create a second picturebox within the first. On this Form, they are named 'tabbox' and 'invbox'."
  399.          FontBold        =   0   'False
  400.          FontItalic      =   0   'False
  401.          FontName        =   "MS Sans Serif"
  402.          FontSize        =   8.25
  403.          FontStrikethru  =   0   'False
  404.          FontUnderline   =   0   'False
  405.          Height          =   495
  406.          Index           =   4
  407.          Left            =   480
  408.          TabIndex        =   19
  409.          Top             =   720
  410.          Width           =   4695
  411.       End
  412.    End
  413.    Begin PictureBox PicBox 
  414.       BackColor       =   &H00C0C0C0&
  415.       Height          =   4215
  416.       Index           =   2
  417.       Left            =   120
  418.       ScaleHeight     =   4185
  419.       ScaleWidth      =   5625
  420.       TabIndex        =   4
  421.       Tag             =   "Step 2"
  422.       Top             =   600
  423.       Width           =   5655
  424.       Begin Label l 
  425.          BackStyle       =   0  'Transparent
  426.          Caption         =   "II. Adding the code."
  427.          FontBold        =   -1  'True
  428.          FontItalic      =   0   'False
  429.          FontName        =   "MS Sans Serif"
  430.          FontSize        =   12
  431.          FontStrikethru  =   0   'False
  432.          FontUnderline   =   0   'False
  433.          Height          =   375
  434.          Index           =   26
  435.          Left            =   120
  436.          TabIndex        =   34
  437.          Top             =   120
  438.          Width           =   5295
  439.       End
  440.       Begin Label l 
  441.          BackStyle       =   0  'Transparent
  442.          Caption         =   "3. Add the follwing line to the tabbox_Paint event:"
  443.          FontBold        =   0   'False
  444.          FontItalic      =   0   'False
  445.          FontName        =   "MS Sans Serif"
  446.          FontSize        =   8.25
  447.          FontStrikethru  =   0   'False
  448.          FontUnderline   =   0   'False
  449.          Height          =   255
  450.          Index           =   19
  451.          Left            =   480
  452.          TabIndex        =   11
  453.          Top             =   3480
  454.          Width           =   4335
  455.       End
  456.       Begin Label l 
  457.          BackStyle       =   0  'Transparent
  458.          Caption         =   "DrawText tabbox, page(), tb"
  459.          FontBold        =   0   'False
  460.          FontItalic      =   0   'False
  461.          FontName        =   "MS Sans Serif"
  462.          FontSize        =   8.25
  463.          FontStrikethru  =   0   'False
  464.          FontUnderline   =   0   'False
  465.          Height          =   255
  466.          Index           =   18
  467.          Left            =   480
  468.          TabIndex        =   12
  469.          Top             =   3720
  470.          Width           =   3015
  471.       End
  472.       Begin Label l 
  473.          BackStyle       =   0  'Transparent
  474.          Caption         =   "TabClick Button, X, Y, tabbox, page(), tb"
  475.          FontBold        =   0   'False
  476.          FontItalic      =   0   'False
  477.          FontName        =   "MS Sans Serif"
  478.          FontSize        =   8.25
  479.          FontStrikethru  =   0   'False
  480.          FontUnderline   =   0   'False
  481.          Height          =   255
  482.          Index           =   17
  483.          Left            =   480
  484.          TabIndex        =   13
  485.          Top             =   3120
  486.          Width           =   4695
  487.       End
  488.       Begin Label l 
  489.          BackStyle       =   0  'Transparent
  490.          Caption         =   "3. Add the follwing line to the tabbox_MouseUp event:"
  491.          FontBold        =   0   'False
  492.          FontItalic      =   0   'False
  493.          FontName        =   "MS Sans Serif"
  494.          FontSize        =   8.25
  495.          FontStrikethru  =   0   'False
  496.          FontUnderline   =   0   'False
  497.          Height          =   255
  498.          Index           =   16
  499.          Left            =   480
  500.          TabIndex        =   14
  501.          Top             =   2880
  502.          Width           =   4335
  503.       End
  504.       Begin Label l 
  505.          BackStyle       =   0  'Transparent
  506.          Caption         =   "DefineControl Me, tabbox, invbox, page(), tb"
  507.          FontBold        =   0   'False
  508.          FontItalic      =   0   'False
  509.          FontName        =   "MS Sans Serif"
  510.          FontSize        =   8.25
  511.          FontStrikethru  =   0   'False
  512.          FontUnderline   =   0   'False
  513.          Height          =   255
  514.          Index           =   15
  515.          Left            =   480
  516.          TabIndex        =   30
  517.          Top             =   2520
  518.          Width           =   4815
  519.       End
  520.       Begin Label l 
  521.          BackStyle       =   0  'Transparent
  522.          Caption         =   "tb.cols = 3"
  523.          FontBold        =   0   'False
  524.          FontItalic      =   0   'False
  525.          FontName        =   "MS Sans Serif"
  526.          FontSize        =   8.25
  527.          FontStrikethru  =   0   'False
  528.          FontUnderline   =   0   'False
  529.          Height          =   255
  530.          Index           =   14
  531.          Left            =   480
  532.          TabIndex        =   29
  533.          Top             =   2280
  534.          Width           =   1215
  535.       End
  536.       Begin Label l 
  537.          BackStyle       =   0  'Transparent
  538.          Caption         =   "For i = 0 to 5: Set page(i) = PicBox(i): Next"
  539.          FontBold        =   0   'False
  540.          FontItalic      =   0   'False
  541.          FontName        =   "MS Sans Serif"
  542.          FontSize        =   8.25
  543.          FontStrikethru  =   0   'False
  544.          FontUnderline   =   0   'False
  545.          Height          =   255
  546.          Index           =   13
  547.          Left            =   480
  548.          TabIndex        =   28
  549.          Top             =   2040
  550.          Width           =   4815
  551.       End
  552.       Begin Label l 
  553.          BackStyle       =   0  'Transparent
  554.          Caption         =   "ReDim page(0 to 5)"
  555.          FontBold        =   0   'False
  556.          FontItalic      =   0   'False
  557.          FontName        =   "MS Sans Serif"
  558.          FontSize        =   8.25
  559.          FontStrikethru  =   0   'False
  560.          FontUnderline   =   0   'False
  561.          Height          =   255
  562.          Index           =   12
  563.          Left            =   480
  564.          TabIndex        =   27
  565.          Top             =   1800
  566.          Width           =   3015
  567.       End
  568.       Begin Label l 
  569.          BackStyle       =   0  'Transparent
  570.          Caption         =   "2. Add the following lines to the Form_Load event:"
  571.          FontBold        =   0   'False
  572.          FontItalic      =   0   'False
  573.          FontName        =   "MS Sans Serif"
  574.          FontSize        =   8.25
  575.          FontStrikethru  =   0   'False
  576.          FontUnderline   =   0   'False
  577.          Height          =   255
  578.          Index           =   11
  579.          Left            =   480
  580.          TabIndex        =   26
  581.          Top             =   1560
  582.          Width           =   3615
  583.       End
  584.       Begin Label l 
  585.          BackStyle       =   0  'Transparent
  586.          Caption         =   "Dim tb as TabData"
  587.          FontBold        =   0   'False
  588.          FontItalic      =   0   'False
  589.          FontName        =   "MS Sans Serif"
  590.          FontSize        =   8.25
  591.          FontStrikethru  =   0   'False
  592.          FontUnderline   =   0   'False
  593.          Height          =   255
  594.          Index           =   10
  595.          Left            =   480
  596.          TabIndex        =   25
  597.          Top             =   1200
  598.          Width           =   3015
  599.       End
  600.       Begin Label l 
  601.          BackStyle       =   0  'Transparent
  602.          Caption         =   "Dim page() as control"
  603.          FontBold        =   0   'False
  604.          FontItalic      =   0   'False
  605.          FontName        =   "MS Sans Serif"
  606.          FontSize        =   8.25
  607.          FontStrikethru  =   0   'False
  608.          FontUnderline   =   0   'False
  609.          Height          =   255
  610.          Index           =   9
  611.          Left            =   480
  612.          TabIndex        =   24
  613.          Top             =   960
  614.          Width           =   3015
  615.       End
  616.       Begin Label l 
  617.          BackStyle       =   0  'Transparent
  618.          Caption         =   "1. Add the following lines to the general declarations section:"
  619.          FontBold        =   0   'False
  620.          FontItalic      =   0   'False
  621.          FontName        =   "MS Sans Serif"
  622.          FontSize        =   8.25
  623.          FontStrikethru  =   0   'False
  624.          FontUnderline   =   0   'False
  625.          Height          =   255
  626.          Index           =   8
  627.          Left            =   480
  628.          TabIndex        =   23
  629.          Top             =   720
  630.          Width           =   4455
  631.       End
  632.    End
  633.    Begin PictureBox PicBox 
  634.       BackColor       =   &H00C0C0C0&
  635.       Height          =   4215
  636.       Index           =   0
  637.       Left            =   720
  638.       ScaleHeight     =   4185
  639.       ScaleWidth      =   5625
  640.       TabIndex        =   2
  641.       Tag             =   "Intro"
  642.       Top             =   600
  643.       Width           =   5655
  644.       Begin Label l 
  645.          Alignment       =   1  'Right Justify
  646.          BackColor       =   &H00C0C0C0&
  647.          BackStyle       =   0  'Transparent
  648.          Caption         =   "Several pictureboxes or frames --------->"
  649.          FontBold        =   0   'False
  650.          FontItalic      =   0   'False
  651.          FontName        =   "MS Sans Serif"
  652.          FontSize        =   8.25
  653.          FontStrikethru  =   0   'False
  654.          FontUnderline   =   0   'False
  655.          Height          =   255
  656.          Index           =   24
  657.          Left            =   600
  658.          TabIndex        =   32
  659.          Top             =   1440
  660.          Width           =   2895
  661.       End
  662.       Begin Label l 
  663.          Alignment       =   1  'Right Justify
  664.          BackColor       =   &H00C0C0C0&
  665.          BackStyle       =   0  'Transparent
  666.          Caption         =   "2 Pictureboxes --------->"
  667.          FontBold        =   0   'False
  668.          FontItalic      =   0   'False
  669.          FontName        =   "MS Sans Serif"
  670.          FontSize        =   8.25
  671.          FontStrikethru  =   0   'False
  672.          FontUnderline   =   0   'False
  673.          Height          =   255
  674.          Index           =   23
  675.          Left            =   1800
  676.          TabIndex        =   31
  677.          Top             =   1080
  678.          Width           =   1695
  679.       End
  680.       Begin Image Image1 
  681.          Height          =   1095
  682.          Left            =   3600
  683.          Picture         =   DIALOG.FRX:0000
  684.          Top             =   840
  685.          Width           =   1575
  686.       End
  687.       Begin Label l 
  688.          Alignment       =   2  'Center
  689.          BackStyle       =   0  'Transparent
  690.          Caption         =   " The following tabs explain the steps required to create this sample."
  691.          FontBold        =   0   'False
  692.          FontItalic      =   0   'False
  693.          FontName        =   "MS Sans Serif"
  694.          FontSize        =   8.25
  695.          FontStrikethru  =   0   'False
  696.          FontUnderline   =   0   'False
  697.          Height          =   255
  698.          Index           =   3
  699.          Left            =   120
  700.          TabIndex        =   18
  701.          Top             =   3840
  702.          Width           =   5295
  703.       End
  704.       Begin Label l 
  705.          Alignment       =   2  'Center
  706.          BackStyle       =   0  'Transparent
  707.          Caption         =   " To handle events, add function calls to the KeyPress and Resize events of your Form, and to the MouseUp and Paint events of the tab picturebox."
  708.          FontBold        =   0   'False
  709.          FontItalic      =   0   'False
  710.          FontName        =   "MS Sans Serif"
  711.          FontSize        =   8.25
  712.          FontStrikethru  =   0   'False
  713.          FontUnderline   =   0   'False
  714.          Height          =   495
  715.          Index           =   2
  716.          Left            =   120
  717.          TabIndex        =   17
  718.          Top             =   3120
  719.          Width           =   5415
  720.       End
  721.       Begin Label l 
  722.          Alignment       =   2  'Center
  723.          BackColor       =   &H00C0C0C0&
  724.          BackStyle       =   0  'Transparent
  725.          Caption         =   "The tab 'control' consists of 2 picture boxes and whatever other controls are needed to implement each 'page':"
  726.          FontBold        =   0   'False
  727.          FontItalic      =   0   'False
  728.          FontName        =   "MS Sans Serif"
  729.          FontSize        =   8.25
  730.          FontStrikethru  =   0   'False
  731.          FontUnderline   =   0   'False
  732.          Height          =   495
  733.          Index           =   0
  734.          Left            =   120
  735.          TabIndex        =   16
  736.          Top             =   240
  737.          Width           =   5415
  738.       End
  739.       Begin Label l 
  740.          Alignment       =   2  'Center
  741.          BackColor       =   &H00C0C0C0&
  742.          BackStyle       =   0  'Transparent
  743.          Caption         =   " To create an instance of the tab control, you must declare a page array, a TabData structure, and create the picture boxes and page controls. You then need only call DefineControl() and pass these elements as parameters."
  744.          FontBold        =   0   'False
  745.          FontItalic      =   0   'False
  746.          FontName        =   "MS Sans Serif"
  747.          FontSize        =   8.25
  748.          FontStrikethru  =   0   'False
  749.          FontUnderline   =   0   'False
  750.          Height          =   735
  751.          Index           =   1
  752.          Left            =   120
  753.          TabIndex        =   15
  754.          Top             =   2160
  755.          Width           =   5415
  756.       End
  757.    End
  758.    Begin Line ln 
  759.       BorderColor     =   &H00FFFFFF&
  760.       Index           =   7
  761.       X1              =   4320
  762.       X2              =   4320
  763.       Y1              =   5280
  764.       Y2              =   5040
  765.    End
  766.    Begin Line ln 
  767.       BorderColor     =   &H00FFFFFF&
  768.       Index           =   6
  769.       X1              =   3960
  770.       X2              =   4200
  771.       Y1              =   5280
  772.       Y2              =   5280
  773.    End
  774.    Begin Line ln 
  775.       BorderColor     =   &H00808080&
  776.       Index           =   5
  777.       X1              =   3840
  778.       X2              =   3840
  779.       Y1              =   5280
  780.       Y2              =   5040
  781.    End
  782.    Begin Line ln 
  783.       BorderColor     =   &H00808080&
  784.       Index           =   4
  785.       X1              =   4200
  786.       X2              =   3840
  787.       Y1              =   5040
  788.       Y2              =   5040
  789.    End
  790.    Begin Line ln 
  791.       BorderColor     =   &H00808080&
  792.       Index           =   3
  793.       X1              =   5880
  794.       X2              =   5880
  795.       Y1              =   0
  796.       Y2              =   3000
  797.    End
  798.    Begin Line ln 
  799.       BorderColor     =   &H00808080&
  800.       Index           =   2
  801.       X1              =   0
  802.       X2              =   3000
  803.       Y1              =   4920
  804.       Y2              =   4920
  805.    End
  806.    Begin Line ln 
  807.       BorderColor     =   &H00FFFFFF&
  808.       Index           =   1
  809.       X1              =   0
  810.       X2              =   0
  811.       Y1              =   0
  812.       Y2              =   3000
  813.    End
  814.    Begin Line ln 
  815.       BorderColor     =   &H00FFFFFF&
  816.       Index           =   0
  817.       X1              =   0
  818.       X2              =   3000
  819.       Y1              =   0
  820.       Y2              =   0
  821.    End
  822. Option Explicit
  823. Dim page() As control
  824. Dim tb As TabData
  825. Sub Form_Load ()
  826. InitializeTabs
  827. End Sub
  828. Sub Form_Resize ()
  829. 'this draws 3d lines on the form
  830. Dim l%, t%, w%, h%
  831. h% = scaleheight - screen.TwipsPerPixelY
  832. w% = scalewidth - screen.TwipsPerPixelX
  833. ln(0).X2 = w
  834. ln(1).Y2 = h
  835. ln(2).Y1 = h
  836. ln(2).Y2 = h
  837. ln(2).X2 = w
  838. ln(3).X1 = w
  839. ln(3).X2 = w
  840. ln(3).Y2 = h
  841. l% = page(0).left - screen.TwipsPerPixelX
  842. t% = page(0).top - screen.TwipsPerPixelY
  843. w% = l + page(0).Width + screen.TwipsPerPixelX
  844. h% = t + page(0).Height + screen.TwipsPerPixelY
  845. ln(4).X1 = l
  846. ln(4).X2 = w
  847. ln(4).Y1 = t
  848. ln(4).Y2 = t
  849. ln(5).X1 = l
  850. ln(5).X2 = l
  851. ln(5).Y1 = t
  852. ln(5).Y2 = h
  853. ln(6).X1 = l
  854. ln(6).X2 = w
  855. ln(6).Y1 = h
  856. ln(6).Y2 = h
  857. ln(7).X1 = w
  858. ln(7).X2 = w
  859. ln(7).Y1 = t
  860. ln(7).Y2 = h
  861. End Sub
  862. Sub InitializeTabs ()
  863. Dim i%, numpages%
  864. numpages = 5            'set to highest index (total-1)
  865. '===create an array of controls ========================
  866. ReDim page(0 To numpages)
  867. For i = 0 To numpages: Set page(i) = PicBox(i): Next
  868. '===fill in the fields of the struct=====================
  869. tb.num = numpages       'number of tabs
  870. tb.active = 0           'initial focus
  871. tb.cols = 3            'number of tabs in each row
  872. tb.orient = tabsup      '0 = up, 1 = down
  873. 'vb won't always reinitialize these to 0
  874. tb.left = 0
  875. tb.top = 0
  876. tb.Width = 0
  877. tb.Height = 0
  878. DefineControl Me, tabbox, invbox, page(), tb
  879. End Sub
  880. Sub tabbox_MouseUp (Button As Integer, Shift As Integer, x As Single, y As Single)
  881. TabClick Button, x, y, tabbox, page(), tb
  882. End Sub
  883. Sub tabbox_Paint ()
  884. DrawText tabbox, page(), tb
  885. End Sub
  886.